export default {
  methods: {
    agree() {
      this.$confirm("确认同意?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(async() => {
        const { success, message } = await this.agreeFunc(this.opId)
        if (success) {
          this.$message({ type: "success", message: "操作成功" })
          this.close && this.close(true)
        } else {
          this.$message({ type: "error", message })
        }
      }).catch(() => {

      })
    },
    disagree(reason) {
      this.$confirm("确认不同意?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(async() => {
        const { success, message } = await this.disagreeFunc(this.opId, reason)
        if (success) {
          this.$message({ type: "success", message: "操作成功" })
          this.close && this.close(true)
        } else {
          this.$message({ type: "error", message })
        }
      }).catch(() => {

      })
    }
  }
}
